package com.shuiyun.jtt.message.jt808;

import com.shuiyun.jtt.anno.Message;
import com.shuiyun.jtt.enums.JT808;
import com.shuiyun.jtt.message.JTMessage;
import com.shuiyun.jtt.message.jt808.extend.InflectionPoint;
import com.shuiyun.jtt.utils.codec.DataType;
import com.shuiyun.jtt.utils.codec.FieldValue;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * @author shuiyun
 * @description 设置路线
 * @date 2022年5月2日22:22:40
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Message(JT808.设置路线0x8606)
public class T8606 extends JTMessage {

    @FieldValue(type = DataType.DWORD,desc = "区域ID")
    @ApiModelProperty(value = "区域ID",example = "1")
    private Integer areaId;


    @FieldValue(type = DataType.WORD,desc = "属性")
    @ApiModelProperty(value = "属性",example = "3",notes = "" +
            "bit0-是否启用开始结束时间判断规则 " +
            "bit2-进入区域是否报警给驾驶员" +
            "bit3-进入区域是否报警给平台" +
            "bit4-离开区域是否报警给驾驶员" +
            "bit5-离开区域是否报警给平台" )
    private Integer attribute;

    @FieldValue(type = DataType.BCD8421,length = 6,desc = "开始时间(yyMMddHHmmss)",checkMethod = {"attribute","&!","1"})
    @ApiModelProperty(value = "开始时间(yyMMddHHmmss)",example = "220202144010")
    private String startTime;

    @FieldValue(type = DataType.BCD8421,length = 6,desc = "结束时间(yyMMddHHmmss)",checkMethod = {"attribute","&!","1"})
    @ApiModelProperty(value = "结束时间(yyMMddHHmmss)",example = "220202144020")
    private String endTime;

    @FieldValue(type = DataType.LIST,lengthSize = 2,desc = "拐点项")
    @ApiModelProperty(value = "拐点项")
    private List<InflectionPoint> points;

    @FieldValue(type = DataType.STRING,lengthSize = 2,desc = "区域名称")
    @ApiModelProperty(value = "区域名称",example = "圆形区域名称")
    private String name;
}
